package ai.plantdata.Structural.mode.ProxyPattern.interfaces.impl;

import ai.plantdata.Structural.mode.ProxyPattern.interfaces.Image;

/**
 * @Author: WangHui
 * @Date: 2020/12/21 17:17
 * @Description:
 */
public class ProxyImage implements Image {
    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName){
        this.fileName = fileName;
    }
    @Override
    public void display() {
        if(realImage == null){
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}
